package me.dracen.web;

import me.dracen.model.UserInfo;
import me.dracen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by liuzinong on 2017/5/12.
 */
@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    public UserService userService;

    @RequestMapping("")
    @ResponseBody
    public List<UserInfo> list () {
        return userService.findAll();
    }
}
